@use '@styles/variables.scss' as *;

.login {
  box-sizing: border-box;
  display: flex;
  width: 100%;
  height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

  .icon {
    width: 32px;
    height: 32px;
  }

  .el-input__inner {
    &:focus {
      border: 1px solid #4e83fd;
    }
  }

  .el-input--medium .el-input__inner {
    height: 48px;
    line-height: 48px;
    border-radius: 8px;
    padding-left: 16px;
  }

  .left-wrap {
    position: relative;
    box-sizing: border-box;
    width: 50vw;
    height: 100%;
    padding: 20px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.8) 0%, rgba(118, 75, 162, 0.8) 100%);
    display: flex;
    align-items: center;
    justify-content: center;

    .logo {
      position: relative;
      z-index: 100;
      display: flex;
      align-items: center;

      .title {
        margin: 3px 0 0 10px;
        font-size: 20px;
        font-weight: 400;
        color: var(--art-text-gray-100);
      }
    }

    .left-bg {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .left-img {
      position: relative;
      z-index: 10;
      display: block;
      width: 80%;
      max-width: 560px;
      margin: auto;
    }

    .text-wrap {
      position: absolute;
      bottom: 80px;
      width: 100%;
      text-align: center;

      h1 {
        font-size: 28px;
        font-weight: 600;
        color: #ffffff;
        margin-bottom: 15px;
      }

      p {
        margin-top: 10px;
        font-size: 16px;
        color: rgba(255, 255, 255, 0.9);
        line-height: 1.6;
      }
    }
  }

  .right-wrap {
    position: relative;
    flex: 1;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--art-bg-color);

    .top-right-wrap {
      position: absolute;
      top: 30px;
      right: 30px;
      z-index: 100;
      display: flex;
      align-items: center;
      justify-content: flex-end;

      .btn {
        display: inline-block;
        width: 40px;
        height: 40px;
        padding: 0;
        margin-left: 15px;
        cursor: pointer;
        user-select: none;
        transition: all 0.3s;
        border-radius: 50%;
        background: #f5f7fa;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);

        i {
          font-size: 18px;
          color: #606266;
        }

        &:hover {
          color: var(--main-color) !important;
          background: #e9ecef;
          transform: translateY(-2px);
        }
      }
    }

    .header {
      display: none;
    }

    .login-wrap {
      position: relative;
      width: 440px;
      padding: 40px;
      margin: auto;
      background: var(--art-bg-color);
      border-radius: 16px;
      box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
      transition: all 0.3s ease;

      &:hover {
        box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
      }

      .form {
        box-sizing: border-box;
        width: 100%;

        .title {
          margin-left: 0;
          font-size: 32px;
          font-weight: 700;
          color: var(--art-text-gray-900) !important;
          text-align: center;
          margin-bottom: 10px;
        }

        .sub-title {
          margin-top: 10px;
          font-size: 16px;
          color: var(--art-text-gray-500) !important;
          text-align: center;
          margin-bottom: 30px;
        }

        .login-tabs {
          display: flex;
          background: #f8f9fa;
          border-radius: 12px;
          padding: 4px;
          margin-bottom: 30px;

          .tab-item {
            flex: 1;
            text-align: center;
            padding: 12px 20px;
            cursor: pointer;
            border-radius: 8px;
            font-size: 16px;
            font-weight: 500;
            transition: all 0.3s;
            color: #6c757d;

            &.active {
              background: #ffffff;
              color: var(--main-color);
              box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
            }

            &:hover:not(.active) {
              background: var(--art-gray-100);
            }
          }
        }

        .el-form-item {
          margin-bottom: 24px;
        }

        .el-input,
        .login-btn {
          height: 48px;
        }

        .drag-verify {
          position: relative;
          padding-bottom: 20px;
          margin-top: 10px;

          .drag-verify-content {
            position: relative;
            z-index: 2;
            box-sizing: border-box;
            user-select: none;
            border-radius: 8px;
            transition: all 0.3s;
            height: 48px;

            &.error {
              border-color: #f56c6c;
            }
          }

          .error-text {
            position: absolute;
            top: 0;
            z-index: 1;
            margin-top: 10px;
            font-size: 13px;
            color: #f56c6c;
            transition: all 0.3s;

            &.show-error-text {
              transform: translateY(58px);
            }
          }
        }

        .captcha-container {
          display: flex;
          gap: 15px;
          align-items: center;

          .captcha-img {
            border-radius: 8px;
            cursor: pointer;
            border: 1px solid #dcdfe6;
            transition: all 0.3s;

            &:hover {
              border-color: #4e83fd;
              box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            }
          }
        }

        .sms-code-container {
          display: flex;
          gap: 15px;
          align-items: center;

          .sms-btn {
            width: 120px;
            height: 48px;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 500;
          }
        }

        .forget-password {
          display: flex;
          align-items: center;
          justify-content: space-between;
          font-size: 14px;
          color: var(--art-text-gray-500);
          margin-bottom: 25px;

          :deep(.el-checkbox) {
            display: flex;
            align-items: center;
            
            .el-checkbox__input {
              display: flex;
              align-items: center;
              justify-content: center;
            }
            
            .el-checkbox__inner {
              width: 18px;
              height: 18px;
              border-radius: 4px;
              
              &::after {
                box-sizing: content-box;
                content: "";
                border: 2px solid var(--el-checkbox-checked-icon-color);
                border-left: 0;
                border-top: 0;
                height: 8px;
                left: 38%;
                position: absolute;
                top: 50%;
                transform: translate(-50%, -50%) rotate(45deg);
                width: 4px;
                transition: transform .15s ease-in .05s;
                transform-origin: center;
              }
            }
          }

          a {
            color: var(--main-color);
            text-decoration: none;
            font-weight: 500;

            &:hover {
              text-decoration: underline;
            }
          }
        }

        .login-btn {
          width: 100%;
          color: #fff;
          border: 0;
          border-radius: 8px;
          font-size: 16px;
          font-weight: 500;
          height: 48px;
          letter-spacing: 1px;
          transition: all 0.3s;
          box-shadow: 0 4px 12px rgba(78, 131, 253, 0.3);

          &:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 16px rgba(78, 131, 253, 0.4);
          }

          &:active {
            transform: translateY(0);
          }
        }

        .footer {
          margin-top: 25px;
          font-size: 14px;
          color: var(--art-text-gray-500);
          text-align: center;

          a {
            color: var(--main-color);
            text-decoration: none;
            font-weight: 500;

            &:hover {
              text-decoration: underline;
            }
          }
        }
      }
    }
  }
}

@media only screen and (max-width: $device-notebook) {
  .login {
    .left-wrap {
      .left-img {
        width: 480px;
        margin-top: 10vh;
      }

      .text-wrap {
        bottom: 40px;
      }
    }
  }
}

@media only screen and (max-width: $device-ipad-pro) {
  .login {
    width: 100%;
    height: 100vh;

    .left-wrap {
      display: none;
    }

    .right-wrap {
      margin: auto;

      .login-wrap {
        position: relative;
        width: 440px;
        padding: 40px;
        border-radius: 16px;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);

        .form {
          margin-top: 0;
        }
      }
    }
  }
}

@media only screen and (max-width: $device-phone) {
  .login {
    position: fixed;
    top: 0;

    .right-wrap {
      box-sizing: border-box;
      width: 100% !important;
      padding: 0 20px;
      margin: auto;

      .login-wrap {
        width: 100%;
        padding: 30px 20px;

        .form {
          margin-top: 0;

          .title {
            font-size: 28px;
          }

          .sub-title {
            font-size: 14px;
          }

          .login-tabs {
            margin-bottom: 25px;
          }

          .el-form-item {
            margin-bottom: 20px;
          }

          .drag-verify {
            margin-top: 5px;
          }

          .forget-password {
            margin-bottom: 20px;
          }
        }
      }
    }
  }
}
